#!/bin/sh

if [[ ! -f ./rsa_private_key.pem ]]; then
    #生成RSA私钥
    openssl genrsa -out rsa_private_key.pem 1024
    #生成RSA公钥
    openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem    
fi
#生成PKCS8 编码的私钥
openssl pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt>rsa_private_key_pkcs8.txt